package com.changan.pojo;

import javax.persistence.*;
import java.sql.Date;
import java.sql.Timestamp;

@Entity
@Table(name = "smbms_user", schema = "smbms", catalog = "")
public class SmbmsUser {
    private long id;
    private String userCode;
    private String userName;
    private String userPassword;
    private Integer gender;
    private Date birthday;
    private String phone;
    private String address;
    private Long userRole;
    private Long createdBy;
    private Timestamp creationDate;
    private Long modifyBy;
    private Timestamp modifyDate;
    private String idPicPath;
    private String workPicPath;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "userCode")
    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    @Basic
    @Column(name = "userName")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "userPassword")
    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    @Basic
    @Column(name = "gender")
    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    @Basic
    @Column(name = "birthday")
    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "phone")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "address")
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "userRole")
    public Long getUserRole() {
        return userRole;
    }

    public void setUserRole(Long userRole) {
        this.userRole = userRole;
    }

    @Basic
    @Column(name = "createdBy")
    public Long getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Long createdBy) {
        this.createdBy = createdBy;
    }

    @Basic
    @Column(name = "creationDate")
    public Timestamp getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Timestamp creationDate) {
        this.creationDate = creationDate;
    }

    @Basic
    @Column(name = "modifyBy")
    public Long getModifyBy() {
        return modifyBy;
    }

    public void setModifyBy(Long modifyBy) {
        this.modifyBy = modifyBy;
    }

    @Basic
    @Column(name = "modifyDate")
    public Timestamp getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Timestamp modifyDate) {
        this.modifyDate = modifyDate;
    }

    @Basic
    @Column(name = "idPicPath")
    public String getIdPicPath() {
        return idPicPath;
    }

    public void setIdPicPath(String idPicPath) {
        this.idPicPath = idPicPath;
    }

    @Basic
    @Column(name = "workPicPath")
    public String getWorkPicPath() {
        return workPicPath;
    }

    public void setWorkPicPath(String workPicPath) {
        this.workPicPath = workPicPath;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SmbmsUser smbmsUser = (SmbmsUser) o;

        if (id != smbmsUser.id) return false;
        if (userCode != null ? !userCode.equals(smbmsUser.userCode) : smbmsUser.userCode != null) return false;
        if (userName != null ? !userName.equals(smbmsUser.userName) : smbmsUser.userName != null) return false;
        if (userPassword != null ? !userPassword.equals(smbmsUser.userPassword) : smbmsUser.userPassword != null)
            return false;
        if (gender != null ? !gender.equals(smbmsUser.gender) : smbmsUser.gender != null) return false;
        if (birthday != null ? !birthday.equals(smbmsUser.birthday) : smbmsUser.birthday != null) return false;
        if (phone != null ? !phone.equals(smbmsUser.phone) : smbmsUser.phone != null) return false;
        if (address != null ? !address.equals(smbmsUser.address) : smbmsUser.address != null) return false;
        if (userRole != null ? !userRole.equals(smbmsUser.userRole) : smbmsUser.userRole != null) return false;
        if (createdBy != null ? !createdBy.equals(smbmsUser.createdBy) : smbmsUser.createdBy != null) return false;
        if (creationDate != null ? !creationDate.equals(smbmsUser.creationDate) : smbmsUser.creationDate != null)
            return false;
        if (modifyBy != null ? !modifyBy.equals(smbmsUser.modifyBy) : smbmsUser.modifyBy != null) return false;
        if (modifyDate != null ? !modifyDate.equals(smbmsUser.modifyDate) : smbmsUser.modifyDate != null) return false;
        if (idPicPath != null ? !idPicPath.equals(smbmsUser.idPicPath) : smbmsUser.idPicPath != null) return false;
        if (workPicPath != null ? !workPicPath.equals(smbmsUser.workPicPath) : smbmsUser.workPicPath != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (userCode != null ? userCode.hashCode() : 0);
        result = 31 * result + (userName != null ? userName.hashCode() : 0);
        result = 31 * result + (userPassword != null ? userPassword.hashCode() : 0);
        result = 31 * result + (gender != null ? gender.hashCode() : 0);
        result = 31 * result + (birthday != null ? birthday.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (userRole != null ? userRole.hashCode() : 0);
        result = 31 * result + (createdBy != null ? createdBy.hashCode() : 0);
        result = 31 * result + (creationDate != null ? creationDate.hashCode() : 0);
        result = 31 * result + (modifyBy != null ? modifyBy.hashCode() : 0);
        result = 31 * result + (modifyDate != null ? modifyDate.hashCode() : 0);
        result = 31 * result + (idPicPath != null ? idPicPath.hashCode() : 0);
        result = 31 * result + (workPicPath != null ? workPicPath.hashCode() : 0);
        return result;
    }
}
